var http = require('./server/httpServer');
var socket = require('./server/socketServer');
var MemoryStore = require('express').session.MemoryStore;
var sessionStore = new MemoryStore();
COLAMIX = {
	test: 'test string aus colamix'
};
_ = '\033[0m'; //reset
R = '\033[31m'; // rot
B = '\033[34m'; // blau
Y = '\033[1;33m'; // gelb
GL = '\033[1;32m';	// hellgrün
G = '\033[0;32m'; // grün
GR = '\033[1;30m';//	 dunkelgrau
//  \033[1;31m	 helles rot

//	\033[0;33m	 braun
//	\033[1;34m	 hellblau
//	\033[0;35m	 dunkellila
//	\033[1;35m	 helllila
//	\033[0;36m	 Dunkeltürkis
//	\033[1;36m	 Türkis
//	\033[0;37m	 Hellgrau


var DbProvider = require('./server/dbProvider')();
DbProvider.setOptions({
	host: '127.0.0.1',
	port: 27017,
	db: 'colamix',
	user: 'dbuser',
	pass: 'dbpass'
});
DbProvider.connect(function(err, db){
	COLAMIX['DB'] = db;
	if(err)console.log('Database  ',R,'Fail: ',err,_);
	else console.log('Database  ',G,'OK',_);
});
var httpServer = http('127.0.0.1', 8081, sessionStore);
console.log('Http      ',G,'OK',_);
var io = socket(httpServer.app, sessionStore);
console.log('Socket    ',G,'OK',_);